package com.neu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.neu.po.ResponseResult;
import com.neu.service.CheckoutService;
import com.neu.vo.CheckinAndCheckout;

@RestController
@RequestMapping("checkout")
public class CheckoutController {
	
	@Autowired
	private CheckoutService  checkoutService;
	
	
	//得到所有付款方式
	@RequestMapping("getAll")
	public ResponseResult getAll() {
		ResponseResult result =new ResponseResult();
		result.setData(checkoutService.getAll());
		return result;
	}
	
	
	//插入退房表和修改入住表状态
	@RequestMapping("insert")
	public ResponseResult insert(@RequestBody CheckinAndCheckout stp) {
		ResponseResult result =new ResponseResult();
		result.setData(checkoutService.insertAndUpdate(stp));
		return result;
	}
	
	
}
